import { S } from '../../s';
import { IPSApplication } from '../../app/ipsapplication';
import { IPSAppDEACMode } from '../../app/dataentity/ipsapp-deacmode';
import { IPSAppDEDataExport } from '../../app/dataentity/ipsapp-dedata-export';
import { IPSAppDEDataImport } from '../../app/dataentity/ipsapp-dedata-import';
import { IPSAppDEMethod } from '../../app/dataentity/ipsapp-demethod';
import { IPSAppDEPrint } from '../../app/dataentity/ipsapp-deprint';
import { IPSAppDEUIAction } from '../../app/dataentity/ipsapp-deuiaction';
import { IPSAppDEUILogic } from '../../app/dataentity/ipsapp-deuilogic';
import { IPSAppDataEntity } from '../../app/dataentity/ipsapp-data-entity';
import { IPSAppUILogic } from '../../app/logic/ipsapp-uilogic';
import { IPSAppView } from '../../app/view/ipsapp-view';
import { IPSNavigateContext } from '../../control/ipsnavigate-context';
import { IPSNavigateParam } from '../../control/ipsnavigate-param';
import { IPSDEOPPriv } from '../priv/ipsdeoppriv';
import { IPSDEUIAction } from './ipsdeuiaction';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysImage } from '../../res/ipssys-image';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';
import { IPSUIAction } from '../../view/ipsuiaction';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEUIActionImpl
  extends PSModelObjectImpl
  implements IPSDEUIAction, IPSAppDEUIAction
{
  get actionLevel(): 50 | 100 | 200 | 250 {
    return this.M.actionLevel != null ? this.M.actionLevel : 100;
  }

  get actionTarget():
    | 'SINGLEDATA'
    | 'SINGLEKEY'
    | 'MULTIDATA'
    | 'MULTIKEY'
    | 'NONE' {
    return this.M.actionTarget;
  }

  get noPrivDisplayMode(): 1 | 2 | 6 {
    return this.M.noPrivDisplayMode != null ? this.M.noPrivDisplayMode : 2;
  }

  protected cmpslanguageres: IPSLanguageRes;
  getCMPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cmpslanguageres ||
      (this.cmpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCMPSLanguageRes,
        S._32f,
      ) as IPSLanguageRes)
    );
  }

  protected cappslanguageres: IPSLanguageRes;
  getCapPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cappslanguageres ||
      (this.cappslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCapPSLanguageRes,
        S._2a8,
      ) as IPSLanguageRes)
    );
  }

  get caption(): string {
    return this.M.caption;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get confirmMsg(): string {
    return this.M.confirmMsg;
  }

  get contextJOString(): string {
    return this.M.contextJOString;
  }

  get counterId(): string {
    return this.M.counterId;
  }

  get dataAccessAction(): string {
    return this.M.dataAccessAction;
  }

  get dialogResult(): 'OK' | 'CANCEL' | 'YES' | 'NO' {
    return this.M.dialogResult;
  }

  protected frontpsappview: IPSAppView;
  getFrontPSAppView(): IPSAppView | null {
    if (this.frontpsappview != null) return this.frontpsappview;
    const value = this.M.getFrontPSAppView;
    if (value == null) {
      return;
    }
    const ipsapplication = this.getParentPSModelObject(
      S._26e,
    ) as IPSApplication;
    if (ipsapplication != null) {
      this.frontpsappview = ipsapplication.findPSAppView(value);
    }
    return this.frontpsappview;
  }

  get frontProcessType():
    | 'WIZARD'
    | 'TOP'
    | 'PRINT'
    | 'DATAIMP'
    | 'DATAEXP'
    | 'CHAT'
    | 'OPENHTMLPAGE'
    | 'OTHER' {
    return this.M.frontProcessType;
  }

  get fullCodeName(): string {
    return this.M.fullCodeName;
  }

  get htmlPageUrl(): string {
    return this.M.htmlPageUrl;
  }

  protected nextpsuiaction: IPSUIAction;
  getNextPSUIAction(): IPSUIAction | null {
    return (
      this.nextpsuiaction ||
      (this.nextpsuiaction = this.fillObjectModel(
        S._29d,
        this.M.getNextPSUIAction,
        S._374,
      ) as IPSUIAction)
    );
  }

  protected psappdeacmode: IPSAppDEACMode;
  getPSAppDEACMode(): IPSAppDEACMode | null {
    if (this.psappdeacmode != null) return this.psappdeacmode;
    const value = this.M.getPSAppDEACMode;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.psappdeacmode = ipsappdataentity.findPSAppDEACMode(value);
    }
    return this.psappdeacmode;
  }

  protected psappdedataexport: IPSAppDEDataExport;
  getPSAppDEDataExport(): IPSAppDEDataExport | null {
    if (this.psappdedataexport != null) return this.psappdedataexport;
    const value = this.M.getPSAppDEDataExport;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.psappdedataexport = ipsappdataentity.findPSAppDEDataExport(value);
    }
    return this.psappdedataexport;
  }

  protected psappdedataimport: IPSAppDEDataImport;
  getPSAppDEDataImport(): IPSAppDEDataImport | null {
    if (this.psappdedataimport != null) return this.psappdedataimport;
    const value = this.M.getPSAppDEDataImport;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.psappdedataimport = ipsappdataentity.findPSAppDEDataImport(value);
    }
    return this.psappdedataimport;
  }

  protected psappdemethod: IPSAppDEMethod;
  getPSAppDEMethod(): IPSAppDEMethod | null {
    if (this.psappdemethod != null) return this.psappdemethod;
    const value = this.M.getPSAppDEMethod;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.psappdemethod = ipsappdataentity.findPSAppDEMethod(value);
    }
    return this.psappdemethod;
  }

  protected psappdeprint: IPSAppDEPrint;
  getPSAppDEPrint(): IPSAppDEPrint | null {
    if (this.psappdeprint != null) return this.psappdeprint;
    const value = this.M.getPSAppDEPrint;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.psappdeprint = ipsappdataentity.findPSAppDEPrint(value);
    }
    return this.psappdeprint;
  }

  protected psappdeuilogic: IPSAppDEUILogic;
  getPSAppDEUILogic(): IPSAppDEUILogic | null {
    if (this.psappdeuilogic != null) return this.psappdeuilogic;
    const value = this.M.getPSAppDEUILogic;
    if (value == null) {
      return;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.psappdeuilogic = ipsappdataentity.findPSAppDEUILogic(value);
    }
    return this.psappdeuilogic;
  }

  protected psappdataentity: IPSAppDataEntity;
  getPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.psappdataentity ||
      (this.psappdataentity = this.fillObjectModel(
        S._f,
        this.M.getPSAppDataEntity,
        S._2aa,
      ) as IPSAppDataEntity)
    );
  }

  protected psappuilogic: IPSAppUILogic;
  getPSAppUILogic(): IPSAppUILogic | null {
    if (this.psappuilogic != null) return this.psappuilogic;
    const value = this.M.getPSAppUILogic;
    if (value == null) {
      return;
    }
    const ipsapplication = this.getParentPSModelObject(
      S._26e,
    ) as IPSApplication;
    if (ipsapplication != null) {
      this.psappuilogic = ipsapplication.findPSAppUILogic(value);
    }
    return this.psappuilogic;
  }

  protected psdeoppriv: IPSDEOPPriv;
  getPSDEOPPriv(): IPSDEOPPriv | null {
    return (
      this.psdeoppriv ||
      (this.psdeoppriv = this.fillObjectModel(
        S._270,
        this.M.getPSDEOPPriv,
        S._2a6,
      ) as IPSDEOPPriv)
    );
  }

  protected psnavigatecontexts: IPSNavigateContext[];
  getPSNavigateContexts(): IPSNavigateContext[] | null {
    return (
      this.psnavigatecontexts ||
      (this.psnavigatecontexts = this.fillChildListModel(
        this.M.getPSNavigateContexts,
        S._8c,
      ) as IPSNavigateContext[])
    );
  }

  findPSNavigateContext(objKey: any): IPSNavigateContext | null {
    return this.getPSModel5(
      S._8c,
      this.getPSNavigateContexts(),
      objKey,
    ) as IPSNavigateContext;
  }

  protected psnavigateparams: IPSNavigateParam[];
  getPSNavigateParams(): IPSNavigateParam[] | null {
    return (
      this.psnavigateparams ||
      (this.psnavigateparams = this.fillChildListModel(
        this.M.getPSNavigateParams,
        S._8a,
      ) as IPSNavigateParam[])
    );
  }

  findPSNavigateParam(objKey: any): IPSNavigateParam | null {
    return this.getPSModel5(
      S._8a,
      this.getPSNavigateParams(),
      objKey,
    ) as IPSNavigateParam;
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  get paramItem(): string {
    return this.M.paramItem;
  }

  get predefinedType(): string {
    return this.M.predefinedType;
  }

  get refreshMode(): 0 | 1 | 2 | 3 {
    return this.M.refreshMode != null ? this.M.refreshMode : 0;
  }

  protected smpslanguageres: IPSLanguageRes;
  getSMPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.smpslanguageres ||
      (this.smpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getSMPSLanguageRes,
        S._375,
      ) as IPSLanguageRes)
    );
  }

  get scriptCode(): string {
    return this.M.scriptCode;
  }

  get successMsg(): string {
    return this.M.successMsg;
  }

  get textItem(): string {
    return this.M.textItem;
  }

  get timeout(): number {
    return this.M.timeout;
  }

  get tooltip(): string {
    return this.M.tooltip;
  }

  protected tooltippslanguageres: IPSLanguageRes;
  getTooltipPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.tooltippslanguageres ||
      (this.tooltippslanguageres = this.fillObjectModel(
        S._276,
        this.M.getTooltipPSLanguageRes,
        S._2c5,
      ) as IPSLanguageRes)
    );
  }

  get uIActionMode():
    | 'SYS'
    | 'FRONT'
    | 'BACKEND'
    | 'WFFRONT'
    | 'WFBACKEND'
    | 'CUSTOM' {
    return this.M.uIActionMode;
  }

  get uIActionParamJO(): IModel {
    return this.M.uIActionParamJO;
  }

  get uIActionTag(): string {
    return this.M.uIActionTag;
  }

  get uIActionType(): string {
    return this.M.uIActionType;
  }

  get uILogicAttachMode(): 'REPLACE' | 'AFTER' {
    return this.M.uILogicAttachMode;
  }

  get uILogicType(): string {
    return this.M.uILogicType;
  }

  get valueItem(): string {
    return this.M.valueItem;
  }

  get closeEditView(): boolean {
    return this.M.closeEditView != null ? this.M.closeEditView : false;
  }

  get closePopupView(): boolean {
    return this.M.closePopupView != null ? this.M.closePopupView : false;
  }

  get enableConfirm(): boolean {
    return this.M.enableConfirm != null ? this.M.enableConfirm : false;
  }

  get enableRuntimeModel(): boolean {
    return this.M.enableRuntimeModel != null
      ? this.M.enableRuntimeModel
      : false;
  }

  get enableToggleMode(): boolean {
    return this.M.enableToggleMode;
  }

  get globalUIAction(): boolean {
    return this.M.globalUIAction != null ? this.M.globalUIAction : false;
  }

  get group(): boolean {
    return this.M.group != null ? this.M.group : false;
  }

  get reloadData(): boolean {
    return this.M.reloadData != null ? this.M.reloadData : false;
  }

  get saveTargetFirst(): boolean {
    return this.M.saveTargetFirst != null ? this.M.saveTargetFirst : false;
  }

  get showBusyIndicator(): boolean {
    return this.M.showBusyIndicator != null ? this.M.showBusyIndicator : true;
  }
  get cls(): string {
    return 'PSDEUIActionImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._286 || cls == S._287 || cls == S._288) return true;
    return super.instanceof(cls);
  }
}
